#include "stdafx.h"
#include "DeviceData.h"


DeviceData::DeviceData(void)
{
	_bValid = TRUE;

	_stationID = 0;
	_addr      = 0XFFFF;
	_btnID     = 0XFFFF;
	_byteFlag  = 0XFFFF;
	_bitFlag   = 0XFFFF;
	_dir       = DIR_UP;
	_boardID   = 0XFFFF;
	_startRow  = 0XFFFF;
}


DeviceData::~DeviceData(void)
{
}


void DeviceData::Serialize(CArchive& ar)
{
	_name.Serialize(ar);

	if (ar.IsStoring())
	{	// storing code
		ar << _bValid << _stationID << _addr << _btnID << _byteFlag << _bitFlag << _dir << _boardID << _startRow;
	}
	else
	{	// loading code
		ar >> _bValid >> _stationID >> _addr >> _btnID >> _byteFlag >> _bitFlag >> _dir >> _boardID >> _startRow;
	}
}


void DeviceData::copyData(DeviceData* pData)
{
	//_name._text = pData->_name._text;
	_addr       = pData->_addr;
	_btnID      = pData->_btnID;
	_byteFlag   = pData->_byteFlag;
	_bitFlag    = pData->_bitFlag;
	_boardID    = pData->_boardID;
	_startRow   = pData->_startRow;
}
